flatMap

inline fun <R> flatMap(transform: (T) -> Option<R>): Option<R>

Maps value of a Some to a new Option using transform or returns the same None.

Return

Option returned by transform or this object if this is a None.

Parameters

transform

Function transforming value of a Some to an Option.